

<template>
  <!-- 团员详情 -->
  <view class="Mall4j page">
    <view v-for="(tempUser, userId) in tempUserList" :key="userId" class="member-list">
      <view class="member-item">
        <view class="head-img">
          <image :src="tempUser.pic?tempUser.pic:'https://mall-1312577323.cos.ap-chengdu.myqcloud.com/mall/images/icon/head04.png'" />
          <!-- 团长标识 -->
          <text v-if="tempUser.identityType ==1" class="group-leader">{{ i18n.teamLeader }}</text>
        </view>
        <view class="member-msg">
          <view class="member-name">{{ tempUser.nickName || '' }}</view>
          <view v-if="tempUser.identityType ==1" class="time">{{ tempUser.createTime }} {{ i18n.startAGroup }}</view>
          <!-- 参团 -->
          <view v-else class="time">{{ tempUser.createTime }} {{ i18n.JoinGroupNow }}</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
// pages/spell-members-details/spell-members-details.js
var http = require('../../../utils/http.js')

export default {

  components: {},
  props: {},
  data () {
    return {
      tempUserList: []
    }
  },

  computed: {
    i18n () {
      return this.$t('index')
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    const groupTeamId = options.groupTeamId
    this.getGroupTeamInfo(groupTeamId)
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () { },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    // 头部导航标题
    uni.setNavigationBarTitle({
      title: this.i18n.membersTheDetails
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () { },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () { },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () { },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () { },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () { },
  methods: {
    /**
     * 获取活动列表
     */
    getGroupTeamInfo: function (groupTempId) {
      const _this = this

      http.request({
        url: '/p/groupTeam/joinUsers',
        method: 'GET',
        data: {
          groupTeamId: groupTempId
        },
        callBack: res => {
          _this.setData({
            tempUserList: res
          })
        }
      })
    }
  }
}
</script>
<style>
@import "./spell-members-details.css";
</style>
